package dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import interfaces.IDaoCompra;
import modelos.Compra;

public class DaoCompra extends DaoGenerico<Compra> implements IDaoCompra {
	public DaoCompra() {
	}
	
	public Compra getPorId(int id) 
	{
		Criteria criteria = this.getCriteria();
		criteria.add(Restrictions.eq("id", id));
		Compra a = (Compra) criteria.uniqueResult();
		return a;
	}
}
